package gmomo.test.gui;

import java.awt.Dimension;

import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeSelectionModel;

public class ContactGUI extends JTree {
	
	private static final long serialVersionUID = 1185860768382565726L;
	
	public ContactGUI(TreeModel model) {
		super(model);
		getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
		setCellRenderer(createCellRender());
		putClientProperty("JTree.lineStyle", "None");
		Dimension size = new Dimension(300,300);
		setPreferredSize(size);
	}
	
	private TreeCellRenderer createCellRender() {
		final DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
        renderer.setOpenIcon(null);
        renderer.setClosedIcon(null);
        renderer.setLeafIcon(null);
        return renderer;
	}
	
}//end of class ContactPanel
